import axios from '@/utils/request'

import config from '@/common/config'

let base = config.getMkBasePath();

/**
 * 代理商产品关系表
 *1    默认只开放普通查询，所有查询，只要上传	 分页参数 {currentPage:当前页码从1开始,pageSize:每页记录数,total:总记录【数如果是0后台会自动计算总记录数非0不会自动计算】}，后台都会自动按分页查询 其它 api用到再打开，没用到的api请注释掉，
 *2 查询、新增、修改的参数格式  params={id:'主键 主键',agentId:'代理商编号',goodsId:'产品编号'}
 **/
 
//普通查询 条件之间and关系  
export const listAgentGoodsRule = params => { return axios.get(`${base}/mk/mng/agent/agentGoodsRule/list`, { params: params }); };

//模糊查询代理商产品关系表 条件之间or关系  
//export const listAgentGoodsRuleKey = params => { return axios.get(`${base}/mk/mng/agent/agentGoodsRule/listKey`, { params: params }); };

//删除一条代理商产品关系表 params={id:'主键 主键'}
export const delAgentGoodsRule = params => { return axios.post(`${base}/mk/mng/agent/agentGoodsRule/del`,params); };

//批量删除代理商产品关系表  params=[{id:'主键 主键'}]
export const batchDelAgentGoodsRule = params => { return axios.post(`${base}/mk/mng/agent/agentGoodsRule/batchDel`, params); };


//修改一条代理商产品关系表记录
export const editAgentGoodsRule = params => { return axios.post(`${base}/mk/mng/agent/agentGoodsRule/edit`, params); };

//新增一条代理商产品关系表
export const addAgentGoodsRule = params => { return axios.post(`${base}/mk/mng/agent/agentGoodsRule/add`, params); };

export const batchSetGoodsRulesToOneAgent = params => { return axios.post(`${base}/mk/mng/agent/agentGoodsRule/batchSetGoodsRulesToOneAgent`, params); };
export const batchSetOneGoodsRuleToAgents = params => { return axios.post(`${base}/mk/mng/agent/agentGoodsRule/batchSetOneGoodsRuleToAgents`, params); };